<template>
  <div class="product-list">
    <!-- 头部搜索 -->
    <el-card class="box-card product-list-card" shadow="never">
     <div slot="header" class="clearfix">
        <CardHeader> </CardHeader>
      </div>
      <cardinput-vue :text="'请输入账号'"></cardinput-vue>
    </el-card>
    <!-- 数据 -->
    <el-card class="box-card product-list-card" shadow="never">
      <div slot="header" class="clearfix">
        <CardDate :shows="false"></CardDate>
      </div>
      <el-table :data="tableData" border style="width: 100%; font-size: 14px;" >
        <el-table-column type="index" label="编号" align="center">
        </el-table-column>
        <el-table-column prop="account_number" label="账号" align="center">
        </el-table-column>
        <el-table-column prop="telephone" label="手机号" align="center">
        </el-table-column>
        <el-table-column prop="password" label="密码" align="center">
        </el-table-column>
        <el-table-column prop="creat_time" label="注册时间" align="center">
        </el-table-column>
        <el-table-column prop="login_time" label="最后登陆" align="center">
        </el-table-column>
        <el-table-column label="是否启动" align="center">
          <template>
            <el-switch v-model="value" active-color="#13ce66" inactive-color="#ff4949">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button size="mini"  @click="handleEdit(scope.$index, scope.row)" >编辑</el-button>
            <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getAdmin } from '@/api';
import CardinputVue from '@/components/commodity/Cardinput.vue';
import CardDate from '@/components/commodity/CardDate.vue';
import CardHeader from '@/components/commodity/CardHeader.vue';
export default {
  name: 'KodaiOrderList',

  data() {
    return {
      tableData: [],
      value:true
    };
  },

  mounted() {
    getAdmin().then(res => {
      this.tableData = res.data.data
      this.value = (this.tableData[0].user_state == '1' ? true : false)

    })
  },

  methods: {

  }, components: {
    CardDate, CardHeader, CardinputVue
  }
};
</script>

<style lang="scss" scoped>
.el-card ::v-deep .el-card__header {
  padding: 2px 10px;
}

</style>